+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
+2001-01-23 <alexl@redhat.com>
+
+ * linux-fb/gdkcursor-fb.c:
+ Don't leak built-in cursors.
+
+ * linux-fb/gdkdrawable-fb2.c (gdk_fb_draw_polygon):
+ Don't leak tmp_points.
+
+ * linux-fb/gdkfont-fb.c (gdk_font_from_description):
+ Don't modify desc. Don't leak font if the PangoFont
+ isn't found.
+
+ * linux-fb/gdkgc-fb.c (gdk_fb_gc_finalize):
+ Free dash_list.
+
+ * linux-fb/gdkkeyboard-fb.c (gdk_fb_handle_key):
+ Don't leak string.
+
2001-01-20 Havoc Pennington <hp@pobox.com>
* gtk/gtktexttag.h (enum GtkWrapMode): rename member fields
static struct {
const guchar *bits;
int width, height, hotx, hoty;
- GdkPixmap *pm;
+ GdkCursor *cursor;
} stock_cursors[] = {
{X_cursor_bits, X_cursor_width, X_cursor_height, X_cursor_x_hot, X_cursor_y_hot},
{X_cursor_mask_bits, X_cursor_mask_width, X_cursor_mask_height, X_cursor_mask_x_hot, X_cursor_mask_y_hot},
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
{
- GdkPixmap *tmp_pm, *pm, *mask;
-
+ GdkCursor *cursor;
+
if (cursor_type >= sizeof(stock_cursors)/sizeof(stock_cursors[0]))
return NULL;
- pm = stock_cursors[cursor_type].pm;
- if (!pm)
+ cursor = stock_cursors[cursor_type].cursor;
+ if (!cursor)
{
+ GdkPixmap *tmp_pm, *pm, *mask;
GdkGC *copy_gc;
char *data;
+
tmp_pm = gdk_bitmap_create_from_data (gdk_parent_root,
stock_cursors[cursor_type].bits,
stock_cursors[cursor_type].width,
stock_cursors[cursor_type].height);
+ /* Create an empty bitmap the size of the mask */
data = g_malloc0 (((stock_cursors[cursor_type+1].width+7)/8) * stock_cursors[cursor_type+1].height);
pm = gdk_bitmap_create_from_data (gdk_parent_root,
data,
g_free (data);
gdk_gc_unref (copy_gc);
- stock_cursors[cursor_type].pm = pm;
- gdk_pixmap_ref (pm);
- }
-
- mask = stock_cursors[cursor_type+1].pm;
- if (!mask)
- {
- mask = stock_cursors[cursor_type+1].pm = gdk_bitmap_create_from_data (gdk_parent_root,
- stock_cursors[cursor_type+1].bits,
- stock_cursors[cursor_type+1].width,
- stock_cursors[cursor_type+1].height);
- gdk_pixmap_ref (mask);
- }
+ mask = gdk_bitmap_create_from_data (gdk_parent_root,
+ stock_cursors[cursor_type+1].bits,
+ stock_cursors[cursor_type+1].width,
+ stock_cursors[cursor_type+1].height);
-
- return gdk_cursor_new_from_pixmap (pm, mask, NULL, NULL,
+ cursor = gdk_cursor_new_from_pixmap (pm, mask, NULL, NULL,
stock_cursors[cursor_type+1].hotx,
stock_cursors[cursor_type+1].hoty);
+
+ stock_cursors[cursor_type].cursor = cursor;
+ }
+ return gdk_cursor_ref (cursor);
}
GdkCursor*
private = (GdkCursorPrivateFB *) cursor;
+ if (private->mask)
+ gdk_pixmap_unref (private->mask);
+ gdk_pixmap_unref (private->cursor);
+
g_free (private);
}
else
{
gint tmp_npoints;
+ gboolean free_points = FALSE;
GdkPoint *tmp_points;
if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y)
{
tmp_npoints = npoints + 1;
tmp_points = g_new (GdkPoint, tmp_npoints);
+ free_points = TRUE;
memcpy (tmp_points, points, sizeof(GdkPoint) * npoints);
tmp_points[npoints].x = points[0].x;
tmp_points[npoints].y = points[0].y;
}
gdk_fb_draw_lines (drawable, gc, tmp_points, tmp_npoints);
+
+ if (free_points)
+ g_free (tmp_points);
}
}
pango_font = pango_context_load_font (context, desc);
if (!pango_font)
{
+ desc = pango_font_description_copy (desc);
g_free (desc->family_name);
desc->family_name = g_strdup ("sans");
pango_font = pango_context_load_font (context, desc);
desc->stretch = PANGO_STRETCH_NORMAL;
pango_font = pango_context_load_font (context, desc);
}
+ pango_font_description_free (desc);
}
g_assert (pango_font != NULL);
if (pango_font == NULL)
- return NULL;
+ {
+ g_free (private);
+ return NULL;
+ }
metrics.ascent = 0;
metrics.descent = 0;
if (private->values.tile)
gdk_pixmap_unref (private->values.tile);
+ g_free (private->dash_list);
+
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
event->key.hardware_keycode = hw_keycode;
event->key.group = group;
}
+ else
+ g_free (string);
}
/******************************************************